<script type="text/javascript" src="/js/jquery.chart/jquery.flot.js"></script>
<script type="text/javascript" src="/modules/mailsystemmodule/js/chart.js"></script>

<span class="form_date">From date</span>&nbsp;
    <input id="_chart_fd" name="from_date" required="true" style="width:110px">
    <span class="form_date">To date</span>&nbsp;
    <input id="_chart_td" name="to_date" required="true"  style="width:110px">
    <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="_view_chart()">View</a>
    <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="_view_chart('hour')">View</a>
    <br>
    
{literal}
 <script type="text/javascript">
 var d = [{/literal}
 {foreach from=$mails item=mail }
 [[{$mail->time}],[{$mail->count}]],
 {/foreach}];
  var e={$chart}
 {literal}

jQuery(document).ready(function()
{
   $.plot($("#placeholder"), [d], {
            xaxis: {
                mode: "time",
                
                min: (new Date(2013, 0, 1)).getTime(),
                max: (new Date(2013, 0, 7)).getTime()
            }
        });
});
 
 {/literal}
</script>
 <div id="placeholder" style="width:600px;height:300px;"></div>

 